home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A is for ART, C is for Cezanne
/
A is for ART, C is for Cezanne.iso
/
mac
/
MEDIA
/
CEZANNE.DIR
/
00009_Script_BUTTONS
< prev
next >
Wrap
Text File
|
1996-05-28
|
5KB
|
188 lines
-- Buttons use global ref (member) to avoid the confusion of memberNum
-- e.g. set the member of sprite x = the number of member y of castlib z
GLOBAL gScreen,gPainting,gSubjList,gScreenList,gTruckBtn,gMusList,gABCbtn, gSketchBtn
GLOBAL gAnimON, gAnimBtn, gDot, gHelpOn, gHelpBtn, hand
PROPERTY rollbtn,normBtn,dnBtn,chan,btnSnd,btnAction,destScr,isOn,coldBtn --,inTransit
PROPERTY rollStates, rollNum
on new me,btnName,channel,soundName,action,destination, rolls --,whatToDoInTransit
set btnAction = action
set destScr = destination
set rollBtn = the number of member(btnName&"Roll") of castLib "BTNS"
set dnBtn = the number of member(btnName&"Dn") of castLib "BTNS"
set normBtn = the number of member btnName of castLib "BTNS"
set coldBtn = the number of member(btnName &"COLD") of castLib "BTNS"
set chan = channel
set btnSnd = soundName
set isOn = TRUE
if not voidP(rolls) then
set rollStates = rolls -1
set rollNum = 0
end if
return me
end
on renameBtn me, newName
-- backBtn on subject screen is "menuBackBtn"
-- function also used to change Truck btn (add/remove) & sketchBookBtn
set normBtn = the number of member newName of castLib "BTNS"
set rollBtn = the number of member(newName&"Roll") of castLib "BTNS"
set dnBtn = the number of member(newName&"Dn") of castLib "BTNS"
end
on setChannel me, channel
set chan = channel
end
on pressDn me
if isOn = false then exit
downBtn me
repeat while the mouseDown
end repeat
cursor 4
if gAnimON then closeAnim gPainting --SUBJECT SCR
doBtnFunction me
end
on select me, spriteNum
set chan = spriteNum
repeat while the mouseDown
nothing
end repeat
doBtnFunction me
end
on clickHelp me
repeat while the mouseDown
nothing
end repeat
doBtnFunction me
end
on updateHelpChan me
set the chan of me = the helpChan of gScreen
end
on doBtnFunction me
if rollover(chan) then
puppetSound member btnSnd of castLib "BTNS"
updateStage
do btnAction
end if
end
on rolloverBtn me
if isOn = FALSE then exit
puppetSprite chan, TRUE
if voidP(rollstates) then set the member of sprite chan = rollBtn
else
------ castmembers must be in order in the castLib
set the member of sprite chan = (rollBtn + rollNum)
if rollNum = rollstates then set rollNum = 0
else set rollNum = rollNum + 1
end if
end
on normalBtn me
puppetSprite chan, TRUE
if isOn = false then
set the member of sprite chan = coldBtn
else
set the member of sprite chan = normBtn
end if
set rollNum = 0
end
on downBtn me
set the member of sprite chan = dnBtn
updateStage
set rollNum = 0
end
on changeCuration me
if gHelpOn then
set gHelpON = 70
set the member of sprite (the helpChan of gScreen) = the number of member "FRONT.H" of castLib "HELP"
--puppetsound 0
end if
if the inMuseum of gPainting = TRUE then
set the inMuseum of gPainting = FALSE
set num = getPos(gMusList,value("#"&the picName of gPainting))
set where = getPropAt(gMusList, num) --#bin or #1, #2, etc
deleteAt(gMusList,num)
if where = #bin then deleteOne(gBinList,the picName of gPainting)
else
----- delete the pic from the room list
deleteProp(value("gWallList" & where),the picName of gPainting)
end if
updateCuratorBtn me
else
add(gBinList,the picName of gPainting)
addProp gMusList,value(#bin),value("#"&the picName of gPainting) -- #loc:symbol
set the inMuseum of gPainting = TRUE
updateCuratorBtn me
driveTruck me
end if
end
on driveTruck me
normalBtn me
set truckNum = the number of member "driveBy" of castLib "BTNS"
set the member of sprite 41 = truckNum
updateStage
repeat with x = 1 to 20
holdON 7
set the member of sprite 41 = truckNum + x
updateStage
end repeat
holdON 7
set the member of sprite 41 = gDot
updateStage
end
on updateCuratorBtn me
if the inMuseum of gPainting = FALSE then
set isOn = #add
renameBtn me, "addMusBtn"
else
set isOn = #remove
renameBtn me, "remMusBtn"
end if
end
on updateABCbtn me, abcVal
set isOn = min(abcVal,1)
end
on updateAnimBtn me, isOnVal
set isOn = isOnVal
set gAnimOn = not isOnVal
normalBtn me
updateStage
end
on toggleBin me, destScr
if destScr = #close then --close the bin
set the member of sprite 33 = gDot -- binBack
set the rect of sprite 33 = rect(427, 372, 427, 372)
set the member of sprite 38 = gDot -- binFront
set the isOn of (getProp(the btnList of gScreen,18)) = FALSE --remBinBtn
renameBtn me, "binOpenBtn"
set the destScr of me = #open
repeat with x = 35 to 37
set the member of sprite x = gDot
end repeat
set the rect of sprite 37 = rect(381, 286, 381, 287)
-- set the cursor of sprite 13 = 0
checkBtns gScreen --to update btns immediately
else
showBin --see MUSEUM MOVIE SCRIPT
end if
end
on resetBinBtn me
renameBtn me, "binCloseBtn"
set the destScr of me = #close
end